package com.xyb.controller;

import com.xyb.entity.Chapter;
import com.xyb.service.WebChapterService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/web/chapter")
public class WebChapterController {
    @Resource
    private WebChapterService webChapterService;

    @GetMapping("/{courseId}")
    public List<Chapter> selectChapterListAndCourseDetailsByCourseId(@PathVariable("courseId") Long courseId){
        return webChapterService.selectChapterListAndCourseDetailsByCourseId(courseId);
    }
}
